]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
authPrompt: Allow to set a custom ShellUserVerifer
authorAlessandro Bono <alessandro.bono369@gmail.com>
Mon, 19 Aug 2024 08:42:08 +0000 (10:42 +0200)
committerMarco Trevisan <mail@3v1n0.net>
Mon, 2 Sep 2024 10:43:24 +0000 (10:43 +0000)
Move ShellUserVerifier creation to its own function so that
extensions can easily override it.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7828
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3446>

js/gdm/authPrompt.js

index 58b1c3cbd4a62b6640b3f3d80aa7a626082482cb..0e0d62ab0873ad32d0d86e1c1aad7d63dd9252a4 100644 (file)
@@ -74,7 +74,7 @@ export const AuthPrompt = GObject.registerClass({
         else if (this._mode === AuthPromptMode.UNLOCK_OR_LOG_IN)
             reauthenticationOnly = false;
 
-        this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, {reauthenticationOnly});
+        this._userVerifier = this._createUserVerifier(this._gdmClient, {reauthenticationOnly});
 
         this._userVerifier.connect('ask-question', this._onAskQuestion.bind(this));
         this._userVerifier.connect('show-message', this._onShowMessage.bind(this));
@@ -124,6 +124,10 @@ export const AuthPrompt = GObject.registerClass({
         this.add_child(this._message);
     }
 
+    _createUserVerifier(gdmClient, params) {
+        return new GdmUtil.ShellUserVerifier(gdmClient, params);
+    }
+
     _onDestroy() {
         this._inactiveEntry.destroy();
         this._inactiveEntry = null;